import { createApp } from 'vue';
import ArcoVue from '@arco-design/web-vue';
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
import globalComponents from '@/components';
import router from './router';
import store from './store';
import directive from './directive';
import App from './App.vue';
import './config/axios-config.ts';
import echarts from '@/utils/echarts';
// elementUI
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import * as elIcons from '@element-plus/icons-vue';
import '@arco-design/web-vue/dist/arco.css';

import '@/assets/style/global.less';

const app = createApp(App);
app.provide('$echarts', echarts);
// 使用	import { ref, inject } from 'vue';
// const Echarts = inject('$echarts');
app.use(ArcoVue);
app.use(ArcoVueIcon);
// app.use(VueAxios, axios);
app.use(store);
app.use(globalComponents);
app.use(directive);
app.use(ElementPlus);
app.use(router);

for (let icon in elIcons) {
  app.component(`ElIcon${icon}`, elIcons[icon]);
}
app.mount('#app');
